<HTML>
<HEAD>
<TITLE>
Comparardor.cpp
</TITLE>
</HEAD>
<BODY>
<PRE>
<font color="blue">#include</font> <font color="maroon">"Comparardor.h"</font>

<font color="blue">int</font> Comparardor<font color="black">:</font><font color="black">:</font>Comparar<font color="black">(</font><font color="blue">char</font> <font color="black">*</font>dato, <font color="blue">char</font> <font color="black">*</font>datoBuscado<font color="black">)</font>
<font color="black">{</font>
    <font color="blue">char</font><font color="black">*</font> aux<font color="black">=</font>datoInfo<font color="black">-</font><font color="black">&#62;</font>GetDato<font color="black">(</font>datoBuscado,<font color="maroon">0</font><font color="black">)</font>;
    <font color="blue">int</font> comparacion<font color="black">=</font>datoInfo<font color="black">-</font><font color="black">&#62;</font>CompararClave<font color="black">(</font>dato,aux<font color="black">)</font>;
    free<font color="black">(</font>aux<font color="black">)</font>;
    <font color="blue">return</font> comparacion;
<font color="black">}</font>

<font color="blue">int</font> Comparardor<font color="black">:</font><font color="black">:</font>Comparar<font color="black">(</font><font color="blue">char</font> <font color="black">*</font>dato, std<font color="black">:</font><font color="black">:</font>string claveBuscada<font color="black">)</font>
<font color="black">{</font>
    <font color="blue">char</font><font color="black">*</font> aux<font color="black">=</font>datoInfo<font color="black">-</font><font color="black">&#62;</font>GetDato<font color="black">(</font>dato,<font color="maroon">0</font><font color="black">)</font>;
    <font color="blue">int</font> comparacion<font color="black">=</font><font color="black">-</font>datoInfo<font color="black">-</font><font color="black">&#62;</font>CompararClave<font color="black">(</font>claveBuscada.c_str<font color="black">(</font><font color="black">)</font>,claveBuscada.length<font color="black">(</font><font color="black">)</font>,aux<font color="black">)</font>;
    free<font color="black">(</font>aux<font color="black">)</font>;
    <font color="blue">return</font> comparacion;
<font color="black">}</font>

Comparardor<font color="black">:</font><font color="black">:</font>Comparardor<font color="black">(</font>PrimaryKey <font color="black">*</font>primaryKey<font color="black">)</font>
<font color="black">{</font>
    <font color="blue">this</font><font color="black">-</font><font color="black">&#62;</font>primaryKey<font color="black">=</font>primaryKey;
    datoInfo<font color="black">=</font><font color="blue">new</font> DatoIndice<font color="black">(</font>NULL, primaryKey<font color="black">)</font>;
<font color="black">}</font>

Comparardor<font color="black">:</font><font color="black">:</font>~Comparardor<font color="black">(</font><font color="black">)</font>
<font color="black">{</font>
    <font color="blue">delete</font> datoInfo;
<font color="black">}</font>

</PRE>
</BODY>
</HTML>
